<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2016/3/8
 * Time: 10:17
 */

namespace app\controllers;


use yii\web\Controller;
use app\models\Article;

class ArticleController extends Controller
{
    public function actionIndex()
    {
        return 'index';
    }

    public function actionAll()
    {
        $model = new Article();
        $datas = $model->getAll();
        foreach ($datas as $value) {
            var_dump($value->id);
            var_dump($value->title);
            var_dump($value->user->name);
        }
    }
}